package com.jyh.controller;

import com.jyh.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/15 16:15
 */
@RestController
@RequestMapping("/animal")
public class Animal {
    @Autowired
    private AliPay aliPay;

    @RequestMapping("/animal")
    public Map animal(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","狗");
        map.put("weight",15);
        return map;
    }

    @Value("${animal.name}")
    private String name;
    @RequestMapping("/name")
    public String name(){
        return "小狗的名字叫"+name;
    }

    @RequestMapping("/aliPay")
    public AliPay aliPay(){
        return aliPay;
    }
}
